#ifndef __TESTLINKLIST_H_
#include <iostream>

#define ElementType int 

struct Node
{
    ElementType data;//数据域
    Node * next;//指针域
};

class TestLinkLIst
{
public:
    TestLinkLIst();
    ~TestLinkLIst();

    void InsertTail(ElementType element);

    void InsertHead(ElementType element);

    void InsertByIndex(int index, ElementType element);
    
    void RemoveByIndex(int index);

    void RemoveByElement(ElementType element);

    void UpdataByIndex(int index, ElementType newValue);

    void UpdataByElement(ElementType oldValue,ElementType newValue);
    
    ElementType & operator[](int index);
    
    void BubbleSort();

    void FastSort();

    TestLinkLIst Merge(const TestLinkLIst & l);

    void Reserve();

    void Reserve2();

    void show();

private:
    void FastSort(Node * start, Node * end);
    Node * Reserve2(Node * node);
    Node * head;
    int size;
};





#endif